﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DAL
{
    using DAL.Entities;

    public class XemlichsubenhDAL : BaseDAL, UTL.IBaseDAL 
    {
        public int Count()
        {
            throw new NotImplementedException();
        }

        public DataTable Select()
        {
            throw new NotImplementedException();
        }

        public DataTable Select(object obj)
        {
            throw new NotImplementedException();
        }

        public object GetByKey(object key)
        {
            throw new NotImplementedException();
        }

        public bool Delete(string id)
        {
            throw new NotImplementedException();
        }

        public bool Insert(object obj)
        {
            throw new NotImplementedException();
        }

        public bool Update(object obj)
        {
            throw new NotImplementedException();
        }

        public DataTable Search(string name)
        {
            throw new NotImplementedException();
        }
        public DataTable Lichsubenhnhan(string a)

        {
            string sql = @"select a.MA_BN,a.HOTEN_BN,b.KETLUANBENH ,b.NGAYKHAM ,b.STTPHIEU,c.TEN_NV
                        from BENHNHAN a join PHIEUKHAM b on a.MA_BN=b.MA_BN join NHANVIEN c on b.MA_NV=c.MA_NV where a.ma_bn='{0}'";
            sql = string.Format(sql,a);
            return ExecuteQuery(sql);
        }
       // public DataTable select_benhnhan()
        //{
        //    string sql = @"select distinct a.ma_bn as id,HOTEN_BN as ten from BENHNHAN a join phieukham b on a.MA_BN=b.MA_BN";
          //  return ExecuteQuery(sql);
        //}
      
        /// <summary>
        /// lay ...
        /// </summary>
        /// <returns></returns>
     

        public bool deleteobj(object obj)
        {
            throw new NotImplementedException();
        }
    }
}
